<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>

<%
	String id = request.getParameter("id");
	if (id == null) {
		id = "";
	}
%>
<script type="text/javascript">
$(function(){
		$('#brandlist').combotree({
			url : '${ctx}/maintenance/brand/treegrid',
			idFiled : 'id',
			textFiled : 'text',
			parentField : 'pid',
			lines : false,
			onLoadSuccess:function(){
				$('#brandlist').combotree('tree').tree('collapseAll');
			}
			
		});
		
		
		$('#pathlist').combotree(
			{
				url :'${ctx}/maintenance/path/treegrid',
				idfiled:'id',
				textFiled : 'text',
				parentField : 'pid',
				lines :true,
				onLoadSuccess:function(){
					
				}
		});
		
		$('#storebylist').combotree(
				{
					url : '${ctx}/autoinn/store/sellist',
					idFiled : 'id',
					textFiled : 'name'

			});
		
	<% if(id!=""){%>

	 $.post('${ctx}/maintenance/product/update/pro/ser', {
			id : $(':input[name="productid"]').val(),
		}, function(result) {
			if (result.productid != undefined) {
				//alert(result.status+" 和"+result.remarks+"还有"+result.sort);
				$('form').form('load', {
				
					'productid' : result.productid,
					'productname' :result.productname,
					'brandId' : result.brandId,
					'pathId' : result.pathId,
					'state' : result.state,
 					'yprice' : result.yprice,
 					'xprice' : result.xprice
				});
			 //alert(result.lid);
				//$('#iconCls').attr('class', result.iconCls);//设置背景图标
			}
			$.messager.progress('close');
		}, 'json');
	 
<%}%>
}); 		
</script>
<div align="center" id="dil">
	<form id="Matnproduct_updateForms" method="post" class="zzld_form">

		<input type="hidden" name="productid" value="<%=id %>" /> <br />
		<table class="zzld_table" style="width: 100%">
			<tr>
				<th>商品：</th>
				<td><input name="productname" value=""
					class="easyui-validatebox" data-options="required:true"
					missingMessage="请编辑商品!" style="width: 98%;" /></td>
				<th>车型:</th>
				<td><input id="brandlist" name="brandId"
					class="easyui-combotree" style="width: 155px;" /></td>
			</tr>
			<tr>
				<th>商品分类:</th>
				<td><input id="pathlist" name="pathId"
					class="easyui-combotree" style="width: 155px;" /></td>
				<th>状态:</th>
				<td><select name="state">
				 <option value="1">启用</option>
				 <option value="0">未启用</option>
				</select></td>
			</tr>
			<tr>

				<th>原价:</th>
				<td><input name="yprice" value=""
					class="easyui-validatebox" data-options="required:true"
					missingMessage="请填写原价!" style="width: 73%;" /></td>
				<th>现价:</th>
				<td><input name="xprice" value=""
					class="easyui-validatebox" style="width: 73%;" />
					</td>
					</tr>
					<tr>
					<th>
					  服务商门店(提供保养服务可选择):
					</th>
					<td><input id="storebylist" name="storeId"
					class="easyui-combotree" style="width: 155px;" /></td>
					</tr>
		</table>

	</form>
</div>